<?php
require_once('../../config.php');
Doctrine::loadModels('../../models');

if( $_GET["fin_year_id"]) // AND $_GET["category_id"] AND $_GET["item_desc"] AND $_GET["item_value"])
{
	$fin_year_id = strip_tags($_GET["fin_year_id"]);
    $year_start = strip_tags($_GET["year_start"]);
    $year_end = strip_tags($_GET["year_end"]);
	$comments = strip_tags($_GET["comments"]);
	
	file_put_contents  ( "params_insert.txt",
								"fin_year_id'" .$fin_year_id.
								"'year_start '" .$year_start.
								"' year_end '" .$year_end.
								"' comments '" .$comments."'");
	 
	//Update Direct to database with SQL until Doctrine issue resolved
	$db_query = sprintf("UPDATE fin_year_summary 
							SET year_start='".$year_start."',
								year_end='".$year_end."',
								comments='".$comments."'
							WHERE fin_year_id='".$fin_year_id."'");
 
 	file_put_contents  ( "update_statement.txt", $db_query);   
 
 	$result = mysql_query($db_query);
    	if (!$result) {
        		die('invalid query');    // . mysql_error());
    		}
}

mysql_free_result( $result )

?>